﻿using System;
using System.Collections.Generic;


namespace CounterServerModel
{
    /// <summary>
    /// A class that represents usage for an Account for a single month.
    /// </summary>
    public class MonthlyUsage
    {
        /// <summary>
        /// The ID of the Account the usage belongs to.
        /// </summary>
        public int AccountID { get; protected set; }

        /// <summary>
        /// An array of usages sorted by usage date.
        /// </summary>
        public SortedList<DateTime, SingleUsage> Usages { get; protected set; }

        public MonthlyUsage(int i_AccountID)
        {
            AccountID = i_AccountID;
            Usages = new SortedList<DateTime, SingleUsage>();
        }

        public void AddUsage(DateTime i_Date, double i_Usage)
        {
            Usages.Add(i_Date, new SingleUsage(i_Date, i_Usage));
        }
    }
}
